Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-developer is "tpl-routes">
Provide a list of the public transport routes available for a given agency, line or passing by a specific stop.
Inputs
A JSON with these parameters:
- agency
string
- URI of the agency whose lines are to be retrieved
- line
string
- URI or shortName of a line (if URI is provided the agency is not needed)
- busstopname
string
- URI or name of a stop (if URI is provided the agency is not needed)
- geometry
boolean
- true/false, if true it returns a “hasGeometry” property for each service stating if the service has a complex WKT
geometries (linestring, polygon) associated with it (if parameter is missing “false” is assumed)
Outputs
- It provides an array of JSON objects of the routes available, for each route is provided: • line: line shot name
• route: the route URI • routeName: optional route name • wktGeometry: the WKT geometry of the route • firstBusStop:
name of the first bus stop • lastBusStop: name of the last bus stop
Details
The node can receive a JSON with the parameters described in the Inputs section and with them generate the output JSON.
If the values are not present in the input JSON, these are read by those in the configuration. If they are not present
in either part, an error is generated for the necessary parameters.